<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:p="http://primefaces.org/ui"
      xmlns:ui="http://java.sun.com/jsf/facelets">
<h:head>
    <title>Modifier un Projet</title>
    <script type="text/javascript" language="javascript">
        function confirmDelete(){
            if (confirm("Voulez-vous supprimer le projet s&eacute;lectionn&eacute; ?"))
                return true;
            return false;
        }
    </script>
</h:head>
<h:body>
    <ui:include src="entete.xhtml"/>
    <h1>Modifier un Projet</h1>
    <hr/>
    <h:form>
        <p:panelGrid columns="2">
            <p:outputLabel value="Nom : "/>
            <p:inputText value="#{projetController.selected.nom}" required="true"/>

            <p:outputLabel value="Description : "/>
            <p:inputTextarea value="#{projetController.selected.description}" cols="20" rows="5"/>

            <p:outputLabel value="Année : "/>
            <p:selectOneRadio id="annee" value="#{projetController.selected.annee}" required="true">
                <f:selectItem id="irm3" itemLabel="IRM 3" itemValue="IRM3" />
                <f:selectItem id="irm4" itemLabel="IRM 4" itemValue="IRM4" />
                <f:selectItem id="irm5" itemLabel="IRM 5" itemValue="IRM5" />
            </p:selectOneRadio>

            <p:outputLabel value="Option : "/>
            <p:selectOneRadio id="option" value="#{projetController.selected.option}" required="true">
                <f:selectItem id="opt0" itemLabel="Sans option" itemValue="NA" />
                <f:selectItem id="optMira" itemLabel="MIRA" itemValue="MIRA" />
                <f:selectItem id="optSica" itemLabel="SICA" itemValue="SICA" />
                <f:selectItem id="optSise" itemLabel="SISE" itemValue="SISE" />
            </p:selectOneRadio>
            
            <p:outputLabel value="Lien : "/>
            <p:inputText value="#{projetController.selected.lien}"/>
        </p:panelGrid>
        <br/>
        <p:dataTable value="#{projetController.tousEtu}" var="etu">
            <p:column>
                <f:facet name="header">
                    <h:outputText value=""/>
                </f:facet>
                <p:selectBooleanCheckbox value="#{etu.selected}"/>
            </p:column>
            <p:column>
                <f:facet name="header">
                    <h:outputText value="Etudiants"/>
                </f:facet>
                <h:outputText value="#{etu.prenom} #{etu.nom}"/>
            </p:column>
        </p:dataTable>
        <br/>
        <p:commandButton value="Enregistrer" action="#{projetController.doSave}"/>
    </h:form>
    <br/>
    <h:form>
        <p:commandButton value="Supprimer" action="#{projetController.doDelete}" onclick="return confirmDelete();"/>
    </h:form>
    <br/>
    <h:form>
        <p:commandButton value="Annuler" action="#{projetController.doCancelEdit}"/>
    </h:form>
    <hr/>
</h:body>
</html>
